<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>云校园管理系统</title>
    <link rel="icon" href="/favicon.ico">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        /* 保持原有样式不变 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
        }

        body {
            overflow: hidden;
            height: 100vh;
            background: linear-gradient(135deg, #e6f7ff 0%, #b3e0ff 100%);
            position: relative;
        }

        #loader {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            z-index: 1000;
            background: linear-gradient(135deg, #e6f7ff 0%, #b3e0ff 100%);
            transition: opacity 0.8s ease, transform 0.8s ease; /* 缩短过渡动画时间 */
        }

        .logo {
            margin-bottom: 30px;
            animation: float 2s ease-in-out infinite; /* 加快浮动动画 */
            text-align: center;
        }

        .logo-icon {
            font-size: 5rem;
            color: #1890ff;
            text-shadow: 0 5px 15px rgba(24, 144, 255, 0.3);
        }

        .logo-text {
            font-size: 2.5rem;
            font-weight: 700;
            color: #1890ff;
            margin-top: 15px;
            letter-spacing: 2px;
        }

        .cloud-loader {
            display: flex;
            justify-content: center;
            margin: 40px 0;
        }

        .cloud {
            width: 80px;
            height: 40px;
            background: white;
            border-radius: 50px;
            position: relative;
            margin: 0 15px;
            box-shadow: 0 10px 20px rgba(24, 144, 255, 0.2);
            animation: cloudFloat 3s ease-in-out infinite; /* 加快云朵浮动 */
        }

        .cloud:nth-child(1) {
            top: -20px;
            animation-delay: 0s;
        }

        .cloud:nth-child(2) {
            top: 0px;
            animation-delay: 0.3s; /* 缩短延迟 */
        }

        .cloud:nth-child(3) {
            top: -20px;
            animation-delay: 0.6s; /* 缩短延迟 */
        }

        .cloud::before,
        .cloud::after {
            content: '';
            position: absolute;
            background: white;
            border-radius: 50%;
        }

        .cloud::before {
            width: 50px;
            height: 50px;
            top: -25px;
            left: 10px;
        }

        .cloud::after {
            width: 40px;
            height: 40px;
            top: -20px;
            right: 10px;
        }

        .progress-container {
            width: 300px;
            height: 12px;
            background: rgba(255, 255, 255, 0.7);
            border-radius: 10px;
            margin: 30px auto;
            overflow: hidden;
            box-shadow: 0 2px 10px rgba(24, 144, 255, 0.2);
        }

        .progress-bar {
            height: 100%;
            width: 0%;
            background: linear-gradient(90deg, #36d1dc, #5b86e5);
            border-radius: 10px;
        }

        .status-text {
            font-size: 1.2rem;
            color: #1890ff;
            margin-top: 20px;
            font-weight: 500;
            height: 25px;
            text-align: center;
        }

        .tip {
            color: #40a9ff;
            margin-top: 25px;
            font-size: 0.9rem;
            max-width: 400px;
            line-height: 1.6;
            text-align: center;
        }

        .decoration {
            position: absolute;
            z-index: 0;
            opacity: 0.3;
        }

        .decoration.circle {
            width: 150px;
            height: 150px;
            border-radius: 50%;
            background: linear-gradient(to right, #36d1dc, #5b86e5);
        }

        .decoration.rect {
            width: 100px;
            height: 100px;
            border-radius: 20px;
            background: linear-gradient(to right, #36d1dc, #5b86e5);
            transform: rotate(45deg);
        }

        .dec-1 {
            top: 10%;
            left: 5%;
            animation: float 8s infinite ease-in-out; /* 加快装饰元素动画 */
        }

        .dec-2 {
            bottom: 15%;
            right: 5%;
            animation: float 10s infinite ease-in-out; /* 加快装饰元素动画 */
        }

        .dec-3 {
            top: 20%;
            right: 10%;
            animation: float 7s infinite ease-in-out; /* 加快装饰元素动画 */
        }

        .dec-4 {
            bottom: 10%;
            left: 10%;
            animation: float 9s infinite ease-in-out; /* 加快装饰元素动画 */
        }

        @keyframes float {
            0% { transform: translateY(0) rotate(0deg); }
            50% { transform: translateY(-20px) rotate(5deg); }
            100% { transform: translateY(0) rotate(0deg); }
        }

        @keyframes cloudFloat {
            0% { transform: translateY(0); }
            50% { transform: translateY(-15px); }
            100% { transform: translateY(0); }
        }

        #app {
            width: 100%;
            height: 100vh;
            overflow: hidden;
        }

        @media (max-width: 768px) {
            .logo-icon {
                font-size: 4rem;
            }

            .logo-text {
                font-size: 2rem;
            }

            .cloud {
                width: 60px;
                height: 30px;
                margin: 0 10px;
            }

            .progress-container {
                width: 250px;
            }

            .tip {
                padding: 0 20px;
            }
        }
    </style>
</head>
<body>
<div id="loader">
    <div class="logo">
        <i class="fas fa-cloud logo-icon"></i>
        <div class="logo-text">云校园管理系统</div>
    </div>

    <div class="cloud-loader">
        <div class="cloud"></div>
        <div class="cloud"></div>
        <div class="cloud"></div>
    </div>

    <div class="progress-container">
        <div class="progress-bar" id="progressBar"></div>
    </div>

    <div class="status-text" id="statusText">正在初始化系统...</div>

    <div class="tip">
        <i class="fas fa-lightbulb"></i> 提示：系统加载中，请稍候...
    </div>

    <div class="decoration circle dec-1"></div>
    <div class="decoration rect dec-2"></div>
    <div class="decoration circle dec-3"></div>
    <div class="decoration rect dec-4"></div>
</div>

<div id="app"></div>

<script type="module" src="/src/main.ts"></script>

<script>
    const loader = document.getElementById('loader');
    const progressBar = document.getElementById('progressBar');
    const statusText = document.getElementById('statusText');

    const statusMessages = [
        "正在初始化系统...",
        "加载核心模块...",
        "准备用户界面...",
        "连接云服务...",
        "验证安全证书...",
        "加载用户数据...",
        "准备就绪..."
    ];

    let progress = 0;
    let currentStatus = 0;

    function updateProgress() {
        if (progress < 100) {
            progress += Math.random() * 8; // 增加每次进度增量
            if (progress > 100) progress = 100;
            progressBar.style.width = progress + '%';
            // 每10%更新一次状态（原15%），加快状态切换
            if (progress > currentStatus * 10 && currentStatus < statusMessages.length) {
                statusText.textContent = statusMessages[currentStatus];
                currentStatus++;
            }

            setTimeout(updateProgress, 30 + Math.random() * 50); // 缩短更新间隔
        } else {
            loader.style.opacity = '0';
            loader.style.transform = 'translateY(-20px)';

            setTimeout(() => {
                loader.style.display = 'none';
            }, 500); // 缩短隐藏延迟
        }
    }

    // 立即开始加载（原延迟500ms）
    updateProgress();
</script>
</body>
</html>
